using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FiltronASP.Helpers.Pagination;
using FiltronASP.Models;

namespace FiltronASP.Areas.Admin.ViewModels.Users
{
    /// <summary>
    /// ViewModel dla akcji <code>Index</code> stron.
    /// </summary>
    public class UsersIndexViewModel : BaseViewModel
    {
        /// <summary>
        /// spaginowana lista stron
        /// </summary>
        public PagedList<User> PaginatedUsers { get; set; }

        /// <summary>
        /// Biezaca strona paginacji.
        /// </summary>
        public int PaginationPage { get; set; }

        /// <summary>
        /// Konstruktor.
        /// </summary>
        public UsersIndexViewModel()
            : base()
        {
        }


        /// <summary>
        /// Konstruktor.
        /// </summary>
        /// <param name="languagesToDropDown">lista jezykow do drop downa</param>
        /// <param name="pageTypesInMenu">lista grup stron do menu z lewej</param>
        /// <param name="menusInMenu">lista menu do menu z lewej</param>
        /// <param name="currentLanguage">aktualna wersja jezykowa</param>
        public UsersIndexViewModel(IQueryable<Language> languagesToDropDown,
            IQueryable<PageType> pageTypesInMenu, 
            IQueryable<Menu> menusInMenu, 
            Language currentLanguage,
            PagedList<User> paginatedUsers,
            int? paginationPage)
            : base(languagesToDropDown, pageTypesInMenu, menusInMenu, currentLanguage)
        {
            this.PaginatedUsers = paginatedUsers;
            this.PaginationPage = paginationPage ?? 1;
        }

        /// <summary>
        /// Konstruktor.
        /// </summary>
        /// <param name="languagesToDropDown">lista jezykow do drop downa</param>
        /// <param name="pageTypesInMenu">lista grup stron do menu z lewej</param>
        /// <param name="menusInMenu">lista menu do menu z lewej</param>
        /// <param name="currentLanguage">aktualna wersja jezykowa</param>
        public UsersIndexViewModel(IQueryable<Language> languagesToDropDown,
            IQueryable<PageType> pageTypesInMenu,
            IQueryable<Menu> menusInMenu,
            Language currentLanguage,
            PagedList<User> paginatedUsers)
            : base(languagesToDropDown, pageTypesInMenu, menusInMenu, currentLanguage)
        {
            this.PaginatedUsers = paginatedUsers;
            this.PaginationPage = 1;
        }

    }
}
